#include "ScrollTree.h"

ScrollTree::ScrollTree(QWidget *parent) : QTreeWidget(parent)
{
    // 鼠标悬浮事件
    this->setMouseTracking(true);
    connect(this, SIGNAL(entered(QModelIndex)), this, SLOT(slotMouseSuspension(QModelIndex)));
}

ScrollTree::~ScrollTree()
{

}

void ScrollTree::slotMouseSuspension(QModelIndex index)
{
    qout QCursor::pos();
    qout index.data().toString();

    QTreeWidgetItem *item = this->itemFromIndex(index);
    if(nullptr != item)
    {
        qout item->text(0);
    }
}
